<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>单页面vue3使用案例</title>
</head>
<body>
<div id="app">
    <div>{{ message }}</div>
    {{ count }}
    <button @click="addCount()">add count</button>
</div>
<script type="module">
    import { createApp, ref } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js'

    createApp({
        setup() {
            const message = ref('hello vue3');
            const count = ref(0);

            let addCount = () => {
                count.value++;
            }
            return {
                message,
                addCount,count
            }
        }
    }).mount("#app")

</script>
</body>
</html>